{temp('admin/head')}

</head>
<body class="page-body">
	
			
		{temp('admin/left')}

			{temp('admin/top')}

			{if(@$r)}
			<div class="row">
				<div class="col-sm-12">
					
					<div class="panel panel-default">
						<div class="panel-heading">
							<h3 class="panel-title">{$tit}</h3>
						</div>
						<div class="panel-body">							
							<div class="form-horizontal">
								<div class="form-group">
									<label class="col-sm-2 control-label" for="field-1">账号</label>
									
									<div class="col-sm-10">
										<div class="form-control" id="zh" style="width:30%;border:0px none;padding:6px 0px;">{$r['username']}</div>
									</div>
								</div>
								
								<div class="form-group-separator"></div>
								{if($_SESSION['admin_id'] == $v_get['id'] || $_SESSION['admin_quanxian'] == 0)}
								<div class="form-group">
									<label class="col-sm-2 control-label" for="field-1">密码</label>
									
									<div class="col-sm-10">
										<input type="password" class="form-control" id="pwd" style="width:30%;" value="{$r['password']}">
									</div>
								</div>
								
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="field-1">确认密码</label>
									
									<div class="col-sm-10">
										<input type="password" class="form-control" id="pwd1" style="width:30%;" value="{$r['password']}">
									</div>
								</div>
								
								<div class="form-group-separator"></div>
								{/if}
								<div class="form-group">
									<label class="col-sm-2 control-label" for="field-1">姓名</label>
									
									<div class="col-sm-10">
										<input type="text" class="form-control" id="name" style="width:30%;" value="{if($r['name'])}{$r['name']}{/if}">
									</div>
								</div>
								
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="field-1">性别</label>
									
									<div class="col-sm-10">
										<div class="radio">
											<label>
												<input name="sex" {if($r['sd'] == 0)}checked="checked"{/if} type="radio" value="0">不告诉你
											</label>
										</div>
										<div class="radio">
											<label>
												<input name="sex" {if($r['sd'] == 1)}checked="checked"{/if} type="radio" value="1">男
											</label>
										</div>
										<div class="radio">
											<label>
												<input name="sex" {if($r['sd'] == 2)}checked="checked"{/if} type="radio" value="2">女
											</label>
										</div>
									</div>									
								</div>
								
								<div class="form-group-separator"></div>
								
								{if($r['sjid'] != 0)}
									{if($_SESSION['admin_id'] == $v_get['id'] || $_SESSION['admin_quanxian'] == 0)}
									<div class="form-group">
										<label class="col-sm-2 control-label" for="field-1">锁定(不能登录)</label>
										
										<div class="col-sm-10">
											<div class="radio">
												<label>
													<input name="sd" {if($r['sd'] == 1)}checked="checked"{/if} type="radio" value="1">是
												</label>
											</div>
											<div class="radio">
												<label>
													<input name="sd" {if($r['sd'] == 0)}checked="checked"{/if} type="radio" value="0">否
												</label>
											</div>
										</div>
									</div>
									
									<div class="form-group-separator"></div>
									{/if}
								{/if}
								
								<div class="form-group">
									<label class="col-sm-2 control-label">组</label>
									
									<div class="col-sm-10" style="width:21%">
										<select class="form-control" id="zuid">
											{foreach($zu as $k => $v)}
											<option value="{$v['id']}" {if($r['zu'] == $v['id'])}selected="selected"{/if}>{$v['name']}</option>
											{/foreach}
										</select>
									</div>
								</div>
								
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<div class="col-sm-10">
										<button class="btn btn-info btn-single pull-right" onclick="xg({$r['id']})" type="button">提交</button>
									</div>
								</div>
							</div>							
						</div>
					</div>
					
				</div>
			</div>
			<script type="text/javascript">
			
			</script>
			{/if}

		{temp('admin/foot')}
		
	<script type="text/javascript">
		function xg(id){
			var pwd = $("#pwd").val();
			var pwd1 = $("#pwd1").val();
			if(pwd != pwd1){
				alert('两次密码不一致');return ;
			}
			var name = $("#name").val();
			var sd = $("input[name='sd']:checked").val();
			var sex = $("input[name='sex']:checked").val();
			var zuid = $("#zuid").val();
			$.post('/admin/?act=xitong&met=admin_xg{$gnpd}',{id:id,pwd:pwd,pwd1:pwd1,name:name,sd:sd,sex:sex,zu:zuid},function(data){
				if(data == 'cg'){
					alert('修改成功');
					location.href = '/admin/?act=xitong&met=guanli{$gnpd}';
				}else if(data == 'error'){
					alert('修改失败');
				}else if(data == '-1'){
					alert('昵称不能为空');
				}else if(data == '-2'){
					alert('密码不能为空');
				}else if(data == '-3'){
					alert('确认密码不能为空');
				}else if(data == '-4'){
					alert('两次密码不一样');
				}
			});
		}
	</script>
	<!-- Bottom Scripts -->
	<script src="{$adstyle}/js/bootstrap.min.js"></script>
	<script src="{$adstyle}/js/TweenMax.min.js"></script>
	<script src="{$adstyle}/js/resizeable.js"></script>
	<script src="{$adstyle}/js/joinable.js"></script>
	<script src="{$adstyle}/js/xenon-api.js"></script>
	<script src="{$adstyle}/js/xenon-toggles.js"></script>

	<!-- Imported scripts on this page -->
	<script src="{$adstyle}/js/select2/select2.min.js"></script>

	<!-- JavaScripts initializations and stuff -->
	<script src="{$adstyle}/js/xenon-custom.js"></script>
</body>
</html>